import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import PageOne from '../views/PageOne'
import PageTwo from '../views/PageTwo'
import PageThree from '../views/PageThree'
import PageFour from '../views/PageFour'
import Index from '../views/Index'
import App from "../App";

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "导航1",
    component: Index,
    redirect: "/pageOne",
    children: [
      {
        path: "/PageOne",
        name: "页面1",
        component: PageOne
      },
      {
        path: "/PageTwo",
        name: "页面2",
        component: PageTwo
      }
    ]
  },
  {
    path: "/navigation",
    name: "导航2",
    component:Index,
    children: [
      {
        path: "/PageThree",
        name: "页面3",
        component: PageThree
      },
      {
        path: "/PageFour",
        name: "页面4",
        component: PageFour
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
